package top.ezzz.util.processtype;

import java.util.HashMap;

public class Holder {

    public static final String JAVA_PROCESS = "java";
    public static final String PYTHON_PROCESS = "python";
    public static final String CPP_PROCESS = "cpp";
    public static final String PORT_PROCESS = "port";


    private final HashMap<String, TypeInterface> processTypeMap = new HashMap<>();

    public Holder() {
        // 只注册 JavaProcess 策略
        processTypeMap.put(JAVA_PROCESS, new JavaProcess());
        processTypeMap.put(PYTHON_PROCESS, new PythonProcess());
        processTypeMap.put(CPP_PROCESS, new CppProcess());
        processTypeMap.put(PORT_PROCESS, new PortProcess());
    }

    public TypeInterface getProcessType(String processName) {
        return processTypeMap.get(processName);
    }
}
